package com.ruoyi.web.controller.pc.anon;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ruoyi.blogs.domain.vo.BsAnswerVo;
import com.ruoyi.blogs.service.IBsAnswerService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api(tags = "回答")
@RestController
@RequestMapping("/anon/answer")
public class AnonAnswerController extends BaseController {
  
    @Autowired
    private IBsAnswerService bsAnswerService;

    /**
     * 查询回答列表
     */
    @ApiOperation("获取回答列表")
    @GetMapping("/list")
    public TableDataInfo list(BsAnswerVo bsAnswerVo)
    {
        startPage();
        try {
            Map<String, Object> map = new HashMap();
            map.put("userId", SecurityUtils.getUserId());
            bsAnswerVo.setParams(map);
        } catch (Exception e) {
            e.printStackTrace();
        }
        List<BsAnswerVo> list = bsAnswerService.selectBsAnswerVoList(bsAnswerVo);
        return getDataTable(list);
    }
}
